package com.atguigu.eduservice.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * @author cyt
 * @create 2020-05-08 20:12
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "edu_video")
public class EduVideo implements Serializable {
    /**
     * 视频ID
     */
    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    private String id;

    /**
     * 课程ID
     */
    @TableField(value = "course_id")
    private String courseId;

    /**
     * 章节ID
     */
    @TableField(value = "chapter_id")
    private String chapterId;

    /**
     * 节点名称
     */
    @TableField(value = "title")
    private String title;

    /**
     * 云端视频资源
     */
    @TableField(value = "video_source_id")
    private String videoSourceId;

    /**
     * 原始文件名称
     */
    @TableField(value = "video_original_name")
    private String videoOriginalName;

    /**
     * 排序字段
     */
    @TableField(value = "sort")
    private Integer sort;

    /**
     * 播放次数
     */
    @TableField(value = "play_count")
    private Long playCount;

    /**
     * 是否可以试听：0收费 1免费
     */
    @TableField(value = "is_free")
    private Boolean isFree;

    /**
     * 视频时长（秒）
     */
    @TableField(value = "duration")
    private Double duration;

    /**
     * Empty未上传 Transcoding转码中  Normal正常
     */
    @TableField(value = "status")
    private String status;

    /**
     * 视频源文件大小（字节）
     */
    @TableField(value = "size")
    private Long size;

    /**
     * 乐观锁
     */
    @Version
    @TableField(value = "version")
    private Long version;

    /**
     * 创建时间
     */
    @TableField(value = "gmt_create", fill = FieldFill.INSERT)

    private Date gmtCreate;

    /**
     * 更新时间
     */
    @TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    private static final long serialVersionUID = 1L;

    public static final String COL_ID = "id";

    public static final String COL_COURSE_ID = "course_id";

    public static final String COL_CHAPTER_ID = "chapter_id";

    public static final String COL_TITLE = "title";

    public static final String COL_VIDEO_SOURCE_ID = "video_source_id";

    public static final String COL_VIDEO_ORIGINAL_NAME = "video_original_name";

    public static final String COL_SORT = "sort";

    public static final String COL_PLAY_COUNT = "play_count";

    public static final String COL_IS_FREE = "is_free";

    public static final String COL_DURATION = "duration";

    public static final String COL_STATUS = "status";

    public static final String COL_SIZE = "size";

    public static final String COL_VERSION = "version";

    public static final String COL_GMT_CREATE = "gmt_create";

    public static final String COL_GMT_MODIFIED = "gmt_modified";
}